<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  <meta name="baidu-site-verification" content="L6Lm9d5Crl">
  
  
  
  
  <title>TimeSilence</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="TimeSilence">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="TimeSilence">
<meta property="og:locale" content="en">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="TimeSilence">
  
    <link rel="alternative" href="/atom.xml" title="TimeSilence" type="application/atom+xml">
  
  
    <link rel="icon" href="/img/002.jpg">
  
  
  <link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.5.0/animate.min.css">
  
  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
  
    
    
  
  
      <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  
  <!-- 加载特效 -->
    <script src="/js/pace.js"></script>
    <link href="/css/pace/pace-theme-flash.css" rel="stylesheet">
  <script>
      var yiliaConfig = {
          fancybox: true,
          animate: true,
          isHome: true,
          isPost: false,
          isArchive: false,
          isTag: false,
          isCategory: false,
          open_in_new: false
      }
  </script>
</head></html>
<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
    <header id="header" class="inner">
        
<script src="https://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>

        <a href="/" class="profilepic">
            
            <img lazy-src="/img/001.jpg" class="js-avatar">
            
        </a>
        <hgroup>
          <h1 class="header-author"><a href="/">TimeSilence</a></h1>
        </hgroup>
        
        
            <form>
                <input type="text" class="st-default-search-input search" id="local-search-input" placeholder="搜索一下" autocomplete="off">
            </form>
            <div id="local-search-result"></div>
        
        
            <script type="text/javascript">
                (function() {
                    'use strict';
                    function getMatchData(keyword, data) {
                        var matchData = [];
                        for(var i =0;i<data.length;i++){
                            if(data[i].title.toLowerCase().indexOf(keyword)>=0) 
                                matchData.push(data[i])
                        }
                        return matchData;
                    }
                    var $input = $('#local-search-input');
                    var $resultContent = $('#local-search-result');
                    $input.keyup(function(){
                        $.ajax({
                            url: '/search.json',
                            dataType: "json",
                            success: function( json ) {
                                var str='<ul class=\"search-result-list\">';                
                                var keyword = $input.val().trim().toLowerCase();
                                $resultContent.innerHTML = "";
                                if ($input.val().trim().length <= 0) {
                                    $resultContent.empty();
                                    $('#switch-area').show();
                                    return;
                                }
                                var results = getMatchData(keyword, json);
                                if(results.length === 0){
                                    $resultContent.empty();
                                    $('#switch-area').show();
                                    return;
                                } 
                                for(var i =0; i<results.length; i++){
                                    str += "<li><a href='"+ results[i].url +"' class='search-result-title'>"+ results[i].title +"</a></li>";
                                }
                                str += "</ul>";
                                $resultContent.empty();
                                $resultContent.append(str);
                                $('#switch-area').hide();
                            }
                        });
                    });
                })();
            </script>
        
        
            <div id="switch-btn" class="switch-btn">
                <div class="icon">
                    <div class="icon-ctn">
                        <div class="icon-wrap icon-house" data-idx="0">
                            <div class="birdhouse"></div>
                            <div class="birdhouse_holes"></div>
                        </div>
                        <div class="icon-wrap icon-ribbon hide" data-idx="1">
                            <div class="ribbon"></div>
                        </div>
                        
                        <div class="icon-wrap icon-link hide" data-idx="2">
                            <div class="loopback_l"></div>
                            <div class="loopback_r"></div>
                        </div>
                        
                        
                        <div class="icon-wrap icon-me hide" data-idx="3">
                            <div class="user"></div>
                            <div class="shoulder"></div>
                        </div>
                        
                    </div>
                </div>
                <div class="tips-box hide">
                    <div class="tips-arrow"></div>
                    <ul class="tips-inner">
                        <li>菜单</li>
                        <li>标签</li>
                        
                        <li>友情链接</li>
                        
                        
                        <li>关于我</li>
                        
                    </ul>
                </div>
            </div>
        
        <div id="switch-area" class="switch-area">
            <div class="switch-wrap">
                <section class="switch-part switch-part1">
                    <nav class="header-menu">
                        <ul>
                        
                            <li><a href="/archives/">所有文章</a></li>
                        
                            <li><a href="/categories/algorithm">算法学习</a></li>
                        
                            <li><a href="/about/">关于我</a></li>
                        
                        </ul>
                    </nav>
                    <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fl github" target="_blank" href="https://github.com/whyzxmsodiao" title="github">github</a>
                            
                                <a class="fl zhihu" target="_blank" href="https://zhihu.com" title="zhihu">zhihu</a>
                            
                        </ul>
                    </nav>
                </section>
                
                <section class="switch-part switch-part2">
                    <div class="widget tagcloud" id="js-tagcloud">
                        <a href="/tags/Java/" style="font-size: 15px;">Java</a> <a href="/tags/Java-EE/" style="font-size: 10px;">Java EE</a> <a href="/tags/QT/" style="font-size: 15px;">QT</a> <a href="/tags/STL/" style="font-size: 10px;">STL</a> <a href="/tags/javaee/" style="font-size: 10px;">javaee</a> <a href="/tags/jdbc/" style="font-size: 10px;">jdbc</a> <a href="/tags/作品/" style="font-size: 10px;">作品</a> <a href="/tags/基础/" style="font-size: 10px;">基础</a> <a href="/tags/算法/" style="font-size: 20px;">算法</a> <a href="/tags/遇到的问题/" style="font-size: 15px;">遇到的问题</a> <a href="/tags/随笔/" style="font-size: 15px;">随笔</a>
                    </div>
                </section>
                
                
                <section class="switch-part switch-part3">
                    <div id="js-friends">
                    
                      <a target="_blank" class="main-nav-link switch-friends-link" href="/www.baidu.com">百度一下</a>
                    
                    </div>
                </section>
                
                
                
                <section class="switch-part switch-part4">
                
                    <div id="js-aboutme">缺乏想象力的狭隘、苛刻、自以为是的命题、空洞的术语、被篡夺的理想、僵化的思想体系——对我来说，真正可怕的是这些东西。</div>
                </section>
                
            </div>
        </div>
    </header>
</div>

    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
      <div class="overlay">
          <div class="slider-trigger"></div>
          <h1 class="header-author js-mobile-header hide"><a href="/" title="回到主页">TimeSilence</a></h1>
      </div>
    <div class="intrude-less">
        <header id="header" class="inner">
            <a href="/" class="profilepic">
                
                    <img lazy-src="/img/001.jpg" class="js-avatar">
                
            </a>
            <hgroup>
              <h1 class="header-author"><a href="/" title="回到主页">TimeSilence</a></h1>
            </hgroup>
            
            <nav class="header-menu">
                <ul>
                
                    <li><a href="/archives/">所有文章</a></li>
                
                    <li><a href="/categories/algorithm">算法学习</a></li>
                
                    <li><a href="/about/">关于我</a></li>
                
                <div class="clearfix"></div>
                </ul>
            </nav>
            <nav class="header-nav">
                <div class="social">
                    
                        <a class="github" target="_blank" href="https://github.com/whyzxmsodiao" title="github">github</a>
                    
                        <a class="zhihu" target="_blank" href="https://zhihu.com" title="zhihu">zhihu</a>
                    
                </div>
            </nav>
        </header>
    </div>
</nav>
      <div class="body-wrap">
  
    <article id="post-QT之数据库" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2021/02/14/QT之数据库/" class="article-date">
      <time datetime="2021-02-14T04:54:15.000Z" itemprop="datePublished">2021-02-14</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2021/02/14/QT之数据库/">QT之数据库</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
        <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">//打印QT支持的数据库驱动</span><br><span class="line">qDebug()&lt;&lt;QSqlDatabase::drivers();</span><br><span class="line">//添加MYSQL数据库</span><br><span class="line">QSqlDatabase db=QSqlDatabase::addDatabase(<span class="string">"QMYSQL"</span>);</span><br><span class="line">//连接数据库</span><br><span class="line">db.setHostName(<span class="string">"localhost"</span>);//数据库服务器IP</span><br><span class="line">db.setUserName(<span class="string">"root"</span>);//数据库用户名</span><br><span class="line">db.setPassword(<span class="string">"123456"</span>);//数据库密码</span><br><span class="line">db.setDatabaseName(<span class="string">"Test"</span>); //使用那个数据库</span><br><span class="line">//打开数据库</span><br><span class="line"><span class="keyword">if</span>(!db.open())</span><br><span class="line">&#123;</span><br><span class="line">	QMessageBox::warning(this,<span class="string">"错误"</span>,db.lastError().text()) //包含QSqlError头文件</span><br><span class="line">	<span class="built_in">return</span>; //数据库打开失败</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">#include &lt;QSqlQuery&gt; //用于对sql语句操作的类</span></span><br><span class="line">QSqlQuery query;</span><br><span class="line">query.exec(<span class="string">"select * from user"</span>);</span><br><span class="line">//批量处理</span><br><span class="line">query.prepare();</span><br><span class="line">query.addBindValue(); //往里面添加list时要是QVariantList</span><br><span class="line">query.execBatch();</span><br><span class="line"></span><br><span class="line">//开启一个事务</span><br><span class="line">QSqlDatabase::database().transaction();</span><br><span class="line">//提交</span><br><span class="line">QSqlDatabase::database().commit();</span><br><span class="line">//回滚</span><br><span class="line">QSqlDatabase::database().rollback();</span><br><span class="line"></span><br><span class="line"><span class="keyword">while</span>(query.next()) //遍历</span><br><span class="line">&#123;</span><br><span class="line">	//取出当前行内容</span><br><span class="line">	qDebug &lt;&lt; query.value(0).toInt(); //取第0列，按列取</span><br><span class="line">	qDebug &lt;&lt; query.value(<span class="string">"id"</span>).toInt(); //按字段名取，更直观</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
    </div>
    
    <div class="article-info article-info-index">
      
      

      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/QT/">QT</a></li></ul>
    </div>

      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-QT笔记-02" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2021/01/31/QT笔记-02/" class="article-date">
      <time datetime="2021-01-31T11:34:35.000Z" itemprop="datePublished">2021-01-31</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2021/01/31/QT笔记-02/">QT笔记_02</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>常用控件<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line">//文字控件</span><br><span class="line">QLabel* label = new QLabel;</span><br><span class="line">label-&gt;setParent(this);</span><br><span class="line">label-&gt;move(0,100);</span><br><span class="line">label-&gt;setText(<span class="string">"hahaha"</span>);</span><br><span class="line">label-&gt;setFont(QFont(<span class="string">"楷体"</span>),20,20,1);</span><br><span class="line">//滑动条控件</span><br><span class="line">QSlider* slider = new QSlider;</span><br><span class="line">slider-&gt;setParent(this);</span><br><span class="line">slider-&gt;move(300,100);</span><br><span class="line">slider-&gt;setValue(0);</span><br><span class="line">//通过滑动条改变字体大小</span><br><span class="line">connect(slider,&amp;QSlider::valueChanged,[label](int _value)&#123;</span><br><span class="line">	label-&gt;setFont(QFont(QFont(<span class="string">"楷体"</span>,_value,10,1)));</span><br><span class="line">	label-&gt;resize(500,_value);</span><br><span class="line">&#125;);</span><br><span class="line">//进度条控件</span><br><span class="line">QProgressBar* proBar = new QProgressBar;</span><br><span class="line">proBar-&gt;setParent(this);</span><br><span class="line">proBar-&gt;move(0,200);</span><br><span class="line">proBar-&gt;resize(this-&gt;size().width(),20);</span><br><span class="line">proBar-&gt;setValue(50);</span><br><span class="line">//通过滑动条控制进度条</span><br><span class="line">connect(slider,&amp;QSlider::valueChanged,[proBar](int _val)&#123;</span><br><span class="line">	proBar-&gt;setValue(_val);</span><br><span class="line">&#125;);</span><br><span class="line">//文本编辑框</span><br><span class="line">QTextEdit* edit = new QTextEdit;</span><br><span class="line">edit-&gt;move(0,300);</span><br><span class="line">edit-&gt;resize(200,500);</span><br><span class="line">edit-&gt;setParent(this);</span><br><span class="line">edit-&gt;setFontUnderline(1);  //添加下划线</span><br><span class="line">edit-&gt;setFontPointSize(qreal(20.0)); //设置文字大小</span><br><span class="line">edit-&gt;setText(<span class="string">"dadada"</span>);  //代码里设置文本内容，添加文本需在样式设置之后执行</span><br><span class="line">//通过编辑文本框改变Label文本类容</span><br><span class="line">connect(edit,&amp;QTextEdit::textChanged,[label]()&#123;</span><br><span class="line">	QString text = edit-&gt;toPlainText();</span><br><span class="line">	label-&gt;setText(text);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure></p>
          
      
    </div>
    
    <div class="article-info article-info-index">
      
      

      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/QT/">QT</a></li></ul>
    </div>

      
        <p class="article-more-link">
          <a href="/2021/01/31/QT笔记-02/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-QT学习笔记" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2021/01/31/QT学习笔记/" class="article-date">
      <time datetime="2021-01-31T06:13:18.000Z" itemprop="datePublished">2021-01-31</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2021/01/31/QT学习笔记/">QT学习笔记</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>*QApplication应用程序类</p>
<pre><code>管理图形用户界面应用程序的控制流和主要设置。
是Qt的整个后台管理的命脉它包含主事件循环，在其中来自窗口系统和其它资源的所有事件处理和调度。它也处理应用程序的初始化和结束，并且提供对话管理。
对于任何一个使用Qt的图形用户界面应用程序，都正好存在一个QApplication 对象，而不论这个应用程序在同一时间内是不是有0、1、2或更多个窗口。
</code></pre><p>*a.exec()</p>
<pre><code>程序进入消息循环，等待对用户输入进行响应。这里main()把控制权转交给Qt，Qt完成事件处理工作，当应用程序退出的时候exec()的值就会返回。
在exec()中，Qt接受并处理用户和系统的事件并且把它们传递给适当的窗口部件。
</code></pre>
          
      
    </div>
    
    <div class="article-info article-info-index">
      
      

      
      
        <p class="article-more-link">
          <a href="/2021/01/31/QT学习笔记/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-STL之string" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2020/06/04/STL之string/" class="article-date">
      <time datetime="2020-06-04T10:06:32.000Z" itemprop="datePublished">2020-06-04</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2020/06/04/STL之string/">STL之string</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>为了建立数据结构和算法的一套标准,便诞生了STL(Standard Template Library,标准模板库)。<br>STL 从广义上分为: 容器(container) 算法(algorithm) 迭代器(iterator)。<br>容器和算法之间通过迭代器进行无缝连接。<br>STL大体分为六大组件，分别是:容器、算法、迭代器、仿函数、适配器（配接器）、空间配置器。<br>
          
      
    </p></div>
    
    <div class="article-info article-info-index">
      
      

      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li></ul>
    </div>

      
        <p class="article-more-link">
          <a href="/2020/06/04/STL之string/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-基数排序" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/09/22/基数排序/" class="article-date">
      <time datetime="2019-09-22T14:27:42.000Z" itemprop="datePublished">2019-09-22</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/22/基数排序/">基数排序</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>基数排序（Radix sort）是一种非比较型整数排序算法，其原理是将整数按位数切割成不同的数字，然后按每个位数分别比较。基数排序是稳定性的排序。<br>它是将所有待比较数值（正整数）统一为同样的数位长度，数位较短的数前面补零。然后，从最低位开始，依次进行一次排序。这样从最低位排序一直到最高位排序完成以后，数列就变成一个有序序列。<br>基数排序的方式可以采用LSD或MSD，LSD的排序方式由键值的最右边开始，而MSD则相反，由键值的最左边开始。<br>
          
      
    </p></div>
    
    <div class="article-info article-info-index">
      
      
    <div class="article-category tagcloud">
    <a class="article-category-link" href="/categories/algorithm/">algorithm</a>
    </div>


      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/算法/">算法</a></li></ul>
    </div>

      
        <p class="article-more-link">
          <a href="/2019/09/22/基数排序/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-GET和POST区别" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/09/18/GET和POST区别/" class="article-date">
      <time datetime="2019-09-18T08:30:19.000Z" itemprop="datePublished">2019-09-18</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/18/GET和POST区别/">GET和POST区别</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
        <p>GET和POST<br>查阅资料后，GET和POST直观的区别有以下：<br>1，GET请求的数据会附在URL之后，以 ? 分割URL和传输数据，参数之间以&amp;相连，<br>POST把提交的数据则放置在请求体中。<br>2，GET没有POST安全，原因是GET参数直接显示在URL中。<br>还有就是w3schools中也说：</p>
<pre><code>1）    GET历史参数保留在浏览器历史中。POST参数不会保存在浏览器历史中。
2）    与 POST 相比，GET 的安全性较差，因为所发送的数据是 URL 的一部分。在发送密码或其他敏感信息时绝不要使用 GET ！POST 比 GET
      更安全，因为参数不会被保存在浏览器历史或 web 服务器日志中。
</code></pre><p>3，GET请求在URL中传送的参数是有长度限制的，而POST是没有的。<br>w3schools中说：</p>
<pre><code>GET对数据长度有限制，当发送数据时，GET 方法向 URL 添加数据；URL 的长度是受限制的（URL 的最大长度是 2048 个字符）。POST无限制。
</code></pre><p>网上碰到一篇文章<a href="https://www.oschina.net/news/77354/http-get-post-different" target="_blank" rel="noopener">99%的人都理解错了HTTP中GET与POST的区别</a><br>里边提到GET和POST还有一个重大区别：</p>
<pre><code>GET产生一个TCP数据包；POST产生两个TCP数据包。
即对于GET方式的请求，浏览器会把http header和data一并发送出去，服务器响应200（返回数据）；
而对于POST，浏览器先发送header，服务器响应100 continue，浏览器再发送data，服务器响应200 ok（返回数据）。
</code></pre>
      
    </div>
    
    <div class="article-info article-info-index">
      
      

      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Java/">Java</a></li></ul>
    </div>

      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-归并排序" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/09/18/归并排序/" class="article-date">
      <time datetime="2019-09-18T07:33:31.000Z" itemprop="datePublished">2019-09-18</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/18/归并排序/">归并排序</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>归并排序<br>归并排序（merge sort）是利用归并的思想实现的排序方法，该算法采用经典的分治（divide-and-conquer）策略（分治法将问题分（divide)成一些小的问题然后递归求解，而治（conquer)的阶段则将分的阶段得到的各答案“修补”在一起，即分而治之）。<br>
          
      
    </p></div>
    
    <div class="article-info article-info-index">
      
      
    <div class="article-category tagcloud">
    <a class="article-category-link" href="/categories/algorithm/">algorithm</a>
    </div>


      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/算法/">算法</a></li></ul>
    </div>

      
        <p class="article-more-link">
          <a href="/2019/09/18/归并排序/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-快速排序" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/09/17/快速排序/" class="article-date">
      <time datetime="2019-09-17T15:06:49.000Z" itemprop="datePublished">2019-09-17</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/17/快速排序/">快速排序</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>快速排序<br>快速排序（Quicksort)是对冒泡排序的一种改进。基本思想是：通过一趟排序将要排序的数据分为独立的两部分，其中一部分的所有数据都比另外一部分的所有数据都要小，然后再按照此方法对这两部分数据分别进行快速排序，整个排序过程可以递归进行，以此达到所有数据变成有序序列。<br>
          
      
    </p></div>
    
    <div class="article-info article-info-index">
      
      
    <div class="article-category tagcloud">
    <a class="article-category-link" href="/categories/algorithm/">algorithm</a>
    </div>


      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/算法/">算法</a></li></ul>
    </div>

      
        <p class="article-more-link">
          <a href="/2019/09/17/快速排序/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-希尔排序" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/09/12/希尔排序/" class="article-date">
      <time datetime="2019-09-12T03:38:53.000Z" itemprop="datePublished">2019-09-12</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/12/希尔排序/">希尔排序</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>插入排序存在的问题。<br>数组arr={2,3,4,5,6,1}时需要插入的数1（最小），这样的过程是：</p>
<pre><code>{2，3，4，5，6，6}
{2，3，4，5，5，6}
{2，3，4，4，5，6}
{2，3，3，4，5，6}
{2，2，3，4，5，6}
{1，2，3，4，5，6}
</code></pre><p>发现当需要插入的数是比较小的数时，后移的次数明显增多，对效率有影响。</p>
<p>希尔排序</p>
<p>希尔排序是希尔（Donald Shell）于1959年提出的一种排序算法。希尔排序也是一种插入排序，他是简单插入排序改进之后的一个更高效的版本，也称为缩小增量排序。<br>
          
      
    </p></div>
    
    <div class="article-info article-info-index">
      
      
    <div class="article-category tagcloud">
    <a class="article-category-link" href="/categories/algorithm/">algorithm</a>
    </div>


      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/算法/">算法</a></li></ul>
    </div>

      
        <p class="article-more-link">
          <a href="/2019/09/12/希尔排序/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
    <article id="post-插入排序" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/09/11/插入排序/" class="article-date">
      <time datetime="2019-09-11T08:26:24.000Z" itemprop="datePublished">2019-09-11</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/11/插入排序/">插入排序</a>
    </h1>
  


      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <p>插入排序</p>
<pre><code>插入排序属于内部排序算法。是对于欲排序的元素以插入的方式寻找该元素的适当位置，以达到排序的目的。
</code></pre><p>插入排序（Insertion Sorting)的基本思想：把n个待排序的元素看成为一个有序表和一个无序表，开始时有序表中只包含一个元素，无序表中包含n-1个元素，排序过程中每次从无序表中取出一个元素，把它的排序码依次和有序表元素进行比较，将它插入到有序表中的适当位置，使之成为新的有序表。<br>
          
      
    </p></div>
    
    <div class="article-info article-info-index">
      
      
    <div class="article-category tagcloud">
    <a class="article-category-link" href="/categories/algorithm/">algorithm</a>
    </div>


      
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/算法/">算法</a></li></ul>
    </div>

      
        <p class="article-more-link">
          <a href="/2019/09/11/插入排序/#more">查看更多 >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>











  
  
    <nav id="page-nav">
      <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><a class="extend next" rel="next" href="/page/2/">Next &raquo;</a>
    </nav>
  

</div>
      <footer id="footer">
    <div class="outer">
        <div id="footer-info">
            <div class="footer-left">
                &copy; 2021 TimeSilence
            </div>
            <div class="footer-right">
                <a href="http://hexo.io/" target="_blank">Hexo &nbsp;&nbsp;</a><a href="https://github.com/maochunguang" target="_blank">Blog</a> by tommy
            </div>
        </div>
        
            <div class="visit">
                
                    <span id="busuanzi_container_site_pv" style="display:none">
                        <span id="site-visit">极客到访数: 
                            <span id="busuanzi_value_site_uv"></span>
                        </span>
                    </span>
                
                
                    <span>, </span>
                
                
                    <span id="busuanzi_container_page_pv" style="display:none">
                        <span id="page-visit">本页阅读量: 
                            <span id="busuanzi_value_page_pv"></span>
                        </span>
                    </span>
                
            </div>
        
    </div>
</footer>

    </div>
    
<script src="https://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>

<script src="/js/main.js"></script>

    <script>
        $(document).ready(function() {
            var backgroundnum = 2;
            var backgroundimg = "url(/background/bg-x.jpg)".replace(/x/gi, Math.ceil(Math.random() * backgroundnum));
            $("#mobile-nav").css({"background-image": backgroundimg,"background-size": "cover","background-position": "center"});
            $(".left-col").css({"background-image": backgroundimg,"background-size": "cover","background-position": "center"});
        })
    </script>


<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'xxxxx', 'auto');
ga('send', 'pageview');

</script>
<!-- End Google Analytics -->



	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?xxxxxx";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>



<div class="scroll" id="scroll">
    <a href="#"><i class="fa fa-arrow-up"></i></a>
    <a href="#comments"><i class="fa fa-comments-o"></i></a>
    <a href="#footer"><i class="fa fa-arrow-down"></i></a>
</div>
<script>
    $(document).ready(function() {
        if ($("#comments").length < 1) {
            $("#scroll > a:nth-child(2)").hide();
        };
    })
</script>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>

  <script language="javascript">
    $(function() {
        $("a[title]").each(function() {
            var a = $(this);
            var title = a.attr('title');
            if (title == undefined || title == "") return;
            a.data('title', title).removeAttr('title').hover(
            function() {
                var offset = a.offset();
                $("<div id=\"anchortitlecontainer\"></div>").appendTo($("body")).html(title).css({
                    top: offset.top - a.outerHeight() - 15,
                    left: offset.left + a.outerWidth()/2 + 1
                }).fadeIn(function() {
                    var pop = $(this);
                    setTimeout(function() {
                        pop.remove();
                    }, pop.text().length * 800);
                });
            }, function() {
                $("#anchortitlecontainer").remove();
            });
        });
    });
</script>


  </div>
</body>
</html>